# from decimal import Decimal
# mydec = Decimal("3.22")
# print(mydec, type(mydec))


#字符串类型
#定义 -- 单引号， 双引号， 三引号
# str1 = 'abc'
# str2 = 'xyz'
# str3 = """
# keyi
# huanhang
# """
#
# print(str3, type(str3))

##############转义字符 以\开头
# print("\ ")
# print("\"")
# print("\\")
# print("\a")


##############字符串的切片处理
#step 默认为1
#1、确定step为正还是为负
#   为正 从前往后截取
#   为负 从后往前截取
#2、确定start和end的位置，start在截取方向上要在end的前面
#3、确定步长
# str1 = "abc123456"
# print(str1[:4])
# print(str1[3:7])
# print(str1[6::-1])
# print(str1[-2:2:-2])
# print(str1[2:-2:-2])
# print(str1[4:-1])

########字符串的拼接
#字符串的级连

# str1 = "xyz""abc"
# print(str1)
# xyzabc

# str3 = "#@"*3
# print(str3)
# #@#@#@

#字符串格式化
# %占位符格式化
# name = input("please input your name"+"\n")
# school = input("please input your school"+"\n")
#
# sdu_info = "my name is %s, my school is %s"%(name,school)
# print(sdu_info)

#%s -- 标志位 控制输出格式
# %s -- str
# %d -- 十进制类型
# %b -- 二进制
# %x -- 十六进制
# %o -- 八进制
# %f -- 浮点型表示
# %% -- 表示百分号本身

######format属性格式化
# name = input("name")
# school = input("school")
#
# format_str1 = "my name is {}, my school is {}".format(name,school)
# print(format_str1)
# format_str2 = "my name is {1}, my school is {0}".format(name,school)
# print(format_str2)
# format_str3 = "my name is {usr}, my school is {sch}".format(usr=name, sch=school)

#控制格式输出
# print("{0:x}".format(30)) #0表示第一个传入的值，x表示十六进制

#python3 支持 --f标志位格式
# name = "sctl"
# age = 18
# str1 = f"my name is {name}, my age is {age}"

#########python字符串的常用属性方法
# print(dir("xxx123"))
# #变量名，属性名 变量名.方法名()
# print(f"是不是全为大写:{'xxxABC'.isupper()}")
# print(f"是不是只有数字:{'1322131'.isdigit()}")
# print(f"是否只包含字母:{'3sa3123'.isalpha()}")
#
# print(f"判断开始字符:{'abc123'.startswith('abc')}")
# print(f"判断开始字符:{'abc123'.startswith('abc',3)}")
# print(f"判断结束字符:{'xyz123'.endswith('123')}")

#从键盘接收用户输入，判断输入是否为整型，包括十进制，二进制，八进制，十六进制
# number = input()
#
# if (number.startswith('0b') and number[2:].isdigit()) or (number.startswith('0x') and number[2:].isdigit()) or (number.startswith('0o') and number[2:].isdigit()) or number.isdigit():{
#     print("True")
# }
# else:
#     print("False")

#字符串的遍历
# for i in "abc":
#     print("*"*10)
#     print(i)

#判断成员关系
# print("a" in "abc")
# print("abc" not in "abs")

number = input()
number_pre = number[0:2]
number_last = number[2:]


if number.isdigit():
    print("True")
elif number_pre == "0b" or number_pre == "0o" or number == "0x":
    if number_pre == "0b":
        patter_str = "01"

    elif number_pre == "0o":
        patter_str = "01234567"

    else :
        patter_str = "0123456789abcdef"
    flag = 0
    for i in number_last:
        if i not in patter_str:
            flag = 1
            break

    if flag == 0:
        print("TRUE")

    else:
        print("FALSE")
else:
    print("FALSE")